package com.njtech.pet.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by 曹家毓 on 2020/4/28.
 */
@Controller
@RequestMapping("")
public class MainController {

    //首页
    @RequestMapping("/home")
    public String home() {
        return "redirect:/";   //去掉jsp解析器的前缀
    }

    //登录
    @RequestMapping("/login")
    public String index() {
        return "login";
    }

    //注册
    @RequestMapping("/regist")
    public String regist() {
        return "regist";
    }

    //客服
    @RequestMapping("/chat")
    public String chat() {
        return "chat1";
    }

    //我的
    @RequestMapping("/myAccount")
    public String myAccount() {
        return "myAccount";
    }

    //商品详情
    @RequestMapping("/productDetail")
    public String productDetail() {
        return "itemDetail";
    }

    //积分中心
    @RequestMapping("/integral")
    public String integral() {
        return "personIntegral";
    }

    //用户个人资料
    @RequestMapping("/personalInfo")
    public String personalInfo() {
        return "personInformation";
    }

    //会员
    @RequestMapping("/associator")
    public String associator() {
        return "personPrivileges";
    }
    //我的收藏
    @RequestMapping("/collect")
    public String collect() {
        return "itemCollect";
    }

    //特权页面
    @RequestMapping("/privilege")
    public String privilege() {
        return "personMember";
    }

    //关联人
    @RequestMapping("/relation")
    public String relation() {
        return "listRelative";
    }

    //我的宠物
    @RequestMapping("/mypet")
    public String mypet() {
        return "listPet";
    }

    //浏览历史
    @RequestMapping("/history")
    public String history() {
        return "itemHistory";
    }

    //订单详情
    @RequestMapping("/buySuccess")
    public String buySuccess() {
        return "orderDetail";
    }

    //我的订单
    @RequestMapping("/myOrders")
    public String myOrders() {
        return "listOrders";
    }

    //所有订单
    @RequestMapping("/allOrders")
    public String allOrders() {
        return "ordersAll";
    }

    //未支付订单
    @RequestMapping("/pendingOrders")
    public String pendingOrders() {
        return "ordersPending";
    }

    //已完成订单
    @RequestMapping("/completeOrders")
    public String completeOrders() {
        return "ordersCompleted";
    }

    //已取消订单
    @RequestMapping("/cancelOrders")
    public String cancelOrders() {
        return "ordersCancelled";
    }

    //添加宠物
    @RequestMapping("/addPet")
    public String addPet() {
        return "addPet";
    }

    //修改宠物
//    @RequestMapping("/changePet")
//    public String changePet() {
//        return "modifyPet";
//    }

//    //修改个人信息
//    @RequestMapping("/modifyInfo")
//    public String modifyInfo() {
//        return "modify_Info";
//    }

//    //修改密码
//    @RequestMapping("/changePwd")
//    public String changePwd() {
//        return "change_pwd";
//    }

    //修改头像
    @RequestMapping("/changeImg")
    public String changeImg() {
        return "modifyImg";
    }

    //添加关联人
    @RequestMapping("/addRelative")
    public String addRelative() {
        return "addRelative";
    }

    //下订单页面
    @RequestMapping("/shoppingcart")
    public String shoppingcart() {
        return "itemPurchase";
    }

    //修改关联人
//    @RequestMapping("/changeRelative")
//    public String changeRelative() {
//        return "modifyRelative";
//    }

//    //搜索历史
//    @RequestMapping("/searchHistory")
//    public String searchHistory() {
//        return "search_history";
//    }

    //404页面
    @RequestMapping("/404error")
    public String Error1() {
        return "404";
    }

    //无权限页面
    @RequestMapping("/NoPermissions")
    public String NoPermissions() {
        return "noPermissions";
    }

    //未登录页面
    @RequestMapping("/NoLogin")
    public String NoLogin() {
        return "NoLogin";
    }
}

